home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
nrpas13.arc
/
RZEXTR.DEM
< prev
next >
Wrap
Text File
|
1991-05-01
|
1KB
|
45 lines
PROGRAM d15r7(input,output);
(* driver for routine RZEXTR *)
CONST
glimax=11;
glnmax=10;
glncol=7;
nv=4;
nuse=5;
TYPE
glyarray = ARRAY [1..nv] OF real;
VAR
glx : ARRAY [1..glimax] OF real;
gld : ARRAY [1..glnmax,1..glncol] OF real;
dum,xest : real;
i,iest,j : integer;
dy,yest,yz : glyarray;
(*$I MODFILE.PAS *)
(*$I RZEXTR.PAS *)
BEGIN
(* feed values from a rational function *)
(* fn(x) := (1-x+x**3)/(x+1)**n *)
FOR i := 1 to 10 DO BEGIN
iest := i;
xest := 1.0/i;
dum := 1.0-xest+xest*xest*xest;
FOR j := 1 to nv DO BEGIN
dum := dum/(xest+1.0);
yest[j] := dum
END;
rzextr(iest,xest,yest,yz,dy,nv,nuse);
writeln;
writeln('iest := ',i:2,' xest =',xest:8:4);
write('Extrap. function: ');
FOR j := 1 to nv DO write(yz[j]:12:6);
writeln;
write('Estimated error: ');
FOR j := 1 to nv DO write(dy[j]:12:6);
writeln
END;
writeln;
writeln('Actual values: ',1.0:12:6,1.0:12:6,1.0:12:6,1.0:12:6)
END.